﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Business;
using Entities;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;

namespace Presentation
{
    public partial class Form1 : DevComponents.DotNetBar.Office2007RibbonForm
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            List<SachDTO> sach = SachService.GetSachList();
            
            
        }

        private void gridView1_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e)
        {
            ColumnView col = sender as ColumnView;
            GridColumn stt = gridView1.Columns[0];
            int n = (int)col.GetRowCellValue(e.RowHandle, stt);
            
            if (n>5)
            {
                e.Valid = false;
                e.ErrorText = "Quá lớn";
            }

        }
    }
}
